import { SkillLevelGetInfo } from "./info/SkillLevelGetInfo";
import { StringHelper } from "../../../com/gengine/utils/StringHelper";
import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
type int = number;
//class SkillLevelGetConfig
    
    export  class SkillLevelGetConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            if (SkillLevelGetConfig._instance != null) 
            {
                throw new Error(" DailyConfig 单例 ");
            }
            this.init();
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new SkillLevelGetInfo();
                loc1.skillId = loc2.skillId;
                loc1.showName = StringHelper.getString(loc2.skillName);
                loc1.showInfo = StringHelper.getString(loc2.skillDes);
                this._map[loc1.skillId] = loc1;
            }
            return;
        }

        public init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_level_skill.json");
            this.write(loc1);
            return;
        }

        public getInfoByName(arg1: int): SkillLevelGetInfo
        {
            return this._map[arg1];
        }

        public getAllList(): Array<any>
        {
            var loc2=null;
            var loc1=[];
            var loc3=0;
            var loc4=this._map;
            for(loc2 of loc4) 
            {
                loc1.push(loc2);
            }
            return loc1;
        }

        public static get instance(): SkillLevelGetConfig
        {
            if (SkillLevelGetConfig._instance == null) 
            {
                SkillLevelGetConfig._instance = new SkillLevelGetConfig();
            }
            return SkillLevelGetConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: SkillLevelGetConfig;
    }
